package top.shen33.yang.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.Version;
import org.apache.commons.lang3.StringUtils;
import top.shen33.yang.base.util.Underline2Camel;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author oreilly
 * @since 2018-08-23
 */
public class MetaColumns extends Model<MetaColumns> {

private static final long serialVersionUID = 1L;

        private String tableCatalog;
        private String tableSchema;
        private String tableName;
        private String columnName;
        private Long ordinalPosition;
        private String columnDefault;
        private String isNullable;
        private String dataType;
        private Long characterMaximumLength;
        private Long characterOctetLength;
        private Long numericPrecision;
        private Long numericScale;
        private Long datetimePrecision;
        private String characterSetName;
        private String collationName;
        private String columnType;
        private String columnKey;
        private String extra;
        private String privileges;
        private String columnComment;
        private String generationExpression;


    public String getTableCatalog() {
            return tableCatalog;
            }

        public void setTableCatalog(String tableCatalog) {
            this.tableCatalog = tableCatalog;
            }

    public String getTableSchema() {
            return tableSchema;
            }

        public void setTableSchema(String tableSchema) {
            this.tableSchema = tableSchema;
            }

    public String getTableName() {
            return tableName;
            }

        public void setTableName(String tableName) {
            this.tableName = tableName;
            }

    public String getColumnName() {

        if(StringUtils.isBlank(columnName)){
            return "";
        }

        if(!columnName.contains("_")){
            return columnName;
        }
        return Underline2Camel.underline2Camel(columnName,true);
    }

        public void setColumnName(String columnName) {
            this.columnName = columnName;
            }

    public Long getOrdinalPosition() {
            return ordinalPosition;
            }

        public void setOrdinalPosition(Long ordinalPosition) {
            this.ordinalPosition = ordinalPosition;
            }

    public String getColumnDefault() {
            return columnDefault;
            }

        public void setColumnDefault(String columnDefault) {
            this.columnDefault = columnDefault;
            }

    public String getIsNullable() {
            return isNullable;
            }

        public void setIsNullable(String isNullable) {
            this.isNullable = isNullable;
            }

    public String getDataType() {
            return dataType;
            }

        public void setDataType(String dataType) {
            this.dataType = dataType;
            }

    public Long getCharacterMaximumLength() {
            return characterMaximumLength;
            }

        public void setCharacterMaximumLength(Long characterMaximumLength) {
            this.characterMaximumLength = characterMaximumLength;
            }

    public Long getCharacterOctetLength() {
            return characterOctetLength;
            }

        public void setCharacterOctetLength(Long characterOctetLength) {
            this.characterOctetLength = characterOctetLength;
            }

    public Long getNumericPrecision() {
            return numericPrecision;
            }

        public void setNumericPrecision(Long numericPrecision) {
            this.numericPrecision = numericPrecision;
            }

    public Long getNumericScale() {
            return numericScale;
            }

        public void setNumericScale(Long numericScale) {
            this.numericScale = numericScale;
            }

    public Long getDatetimePrecision() {
            return datetimePrecision;
            }

        public void setDatetimePrecision(Long datetimePrecision) {
            this.datetimePrecision = datetimePrecision;
            }

    public String getCharacterSetName() {
            return characterSetName;
            }

        public void setCharacterSetName(String characterSetName) {
            this.characterSetName = characterSetName;
            }

    public String getCollationName() {
            return collationName;
            }

        public void setCollationName(String collationName) {
            this.collationName = collationName;
            }

    public String getColumnType() {
            return columnType;
            }

        public void setColumnType(String columnType) {
            this.columnType = columnType;
            }

    public String getColumnKey() {
            return columnKey;
            }

        public void setColumnKey(String columnKey) {
            this.columnKey = columnKey;
            }

    public String getExtra() {
            return extra;
            }

        public void setExtra(String extra) {
            this.extra = extra;
            }

    public String getPrivileges() {
            return privileges;
            }

        public void setPrivileges(String privileges) {
            this.privileges = privileges;
            }

    public String getColumnComment() {
            return columnComment;
            }

        public void setColumnComment(String columnComment) {
            this.columnComment = columnComment;
            }

    public String getGenerationExpression() {
            return generationExpression;
            }

        public void setGenerationExpression(String generationExpression) {
            this.generationExpression = generationExpression;
            }

@Override
protected Serializable pkVal() {
            return null;
        }

@Override
public String toString() {
        return "MetaColumns{" +
                ", tableCatalog=" + tableCatalog +
                ", tableSchema=" + tableSchema +
                ", tableName=" + tableName +
                ", columnName=" + columnName +
                ", ordinalPosition=" + ordinalPosition +
                ", columnDefault=" + columnDefault +
                ", isNullable=" + isNullable +
                ", dataType=" + dataType +
                ", characterMaximumLength=" + characterMaximumLength +
                ", characterOctetLength=" + characterOctetLength +
                ", numericPrecision=" + numericPrecision +
                ", numericScale=" + numericScale +
                ", datetimePrecision=" + datetimePrecision +
                ", characterSetName=" + characterSetName +
                ", collationName=" + collationName +
                ", columnType=" + columnType +
                ", columnKey=" + columnKey +
                ", extra=" + extra +
                ", privileges=" + privileges +
                ", columnComment=" + columnComment +
                ", generationExpression=" + generationExpression +
        "}";
        }
        }
